package migration

import (
	"api/model"
	"fmt"
	"migrate/app/migrate"

	"gorm.io/gorm"
)

func init() {
	migrate.AddMigration(&migrate.Migration{
		Version: "m_20220614234715_create_role",
		Up:      m_20220614234715_create_role_up,
		Down:    m_20220614234715_create_role_down,
	})
}

func m_20220614234715_create_role_up(db *gorm.DB) error {
	return db.AutoMigrate(&model.Role{})
}

func m_20220614234715_create_role_down(db *gorm.DB) error {
	fmt.Println("m_20220614234715_create_roles_down")
	return nil
}
